<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2020/7/26
  Time: 16:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>影院票务管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/front/style/CSS/normalize.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/front/style/CSS/bangdan.css">
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/front/style/IMG/Blogo.png" type="image/x-icon">
</head>

<body>
<!-- 顶部 -->
<header class="dingbu">
    <nav>
        <a href="#" class="logo"></a>
        <ul class="navbar">
            <li>
                <a href="${pageContext.request.contextPath}/front/index.jsp">首页</a>
            </li>
            <li>
                <a href="${pageContext.request.contextPath}/front/movie.jsp">电影</a>
            </li>
            <li style="background-color: #FFF">
                <a href="${pageContext.request.contextPath}/front/filmRank.jsp" style="color: #000000">排行榜</a>
            </li>
            <li>
                <a href="${pageContext.request.contextPath}/front/screening.jsp">场次安排</a>
            </li>
            <li style="background-color: #ef4238">
                <a href="${pageContext.request.contextPath}/front/vipRecharge.jsp" style="color: #FFF">会员卡</a>
            </li>
            <li>
                <a href="${pageContext.request.contextPath}/front/userOrders.jsp">个人信息</a>
            </li>
        </ul>

        <div class="sousuo">
        </div>
        <div class="denglu bian">
            <a href="#">
                <img src="${pageContext.request.contextPath}/front/style/IMG/avatar.png" alt="">
            </a>
            <span class="sanjiao"></span>
            <div>
                <a id="showStatus" href="${pageContext.request.contextPath}/front/accountLogin.jsp">登录</a>
            </div>
        </div>
    </nav>
</header>
<!-- 榜单 -->
<div class="header">
    <ul>
        <li>
            <a href="#">会员卡</a>
        </li>
    </ul>
</div>
<!-- 内容区域 -->
<div class="content">
    <div class="content1" id="filmRankList">
        <dl>
           <dd>

                <div>
                    <i class="No1"></i>
                </div>
                <div class="img">
                    <a href="#">
                        <img src="${pageContext.request.contextPath}/front/style/IMG/vip3.jpg" alt="">
                    </a>
                </div>
                <div>
                    <div>
                        <a href="${pageContext.request.contextPath}/front/style/HTML/dianyingxiangqing.html" title="年卡"></a>
                        <p>

                            会员包年

                        </p>
                        <p>享受全年票价7折优惠</p>
                        <%--<a  href="${pageContext.request.contextPath}/front/vipPayYear.jsp">点击购买</a>--%>
                        <input name="购买" type="button" id="btn3" value="购买" />
                        <input type="hidden" name="type" id="type3"  value="Y" />
                        <input type="hidden" name="price" id="price3"  value="720" />
                    </div>
                    <div>
                        <i>全年/720RMB</i>
                    </div>
                </div>
            </dd>
                <dd>

                    <div>
                        <i class="No1"></i>
                    </div>
                    <div class="img">
                        <a href="#">
                            <img src="${pageContext.request.contextPath}/front/style/IMG/vip2.jpg" alt="">
                        </a>
                    </div>
                    <div>
                        <div>
                            <a href="${pageContext.request.contextPath}/front/style/HTML/dianyingxiangqing.html" title="季卡"></a>
                            <p>

                                会员包季

                            </p>
                            <p>享受季度票价8折优惠</p>
                            <%--<a  href="${pageContext.request.contextPath}/front/vipPaySeason.jsp">点击购买</a>--%>
                            <input name="购买" type="button" id="btn2" value="购买" />
                            <input type="hidden" name="type" id="type2"  value="S" />
                            <input type="hidden" name="price" id="price2"  value="180" />

                        </div>
                        <div>
                            <i>季度/180RMB</i>
                        </div>
                    </div>
                </dd>
                    <dd>

                        <div>
                            <i class="No1"></i>
                        </div>
                        <div class="img">
                            <a href="#">
                                <img src="${pageContext.request.contextPath}/front/style/IMG/vip1.jpg" alt="">
                            </a>
                        </div>
                        <div>
                            <div>
                                <a href="${pageContext.request.contextPath}/front/style/HTML/dianyingxiangqing.html" title="月卡"></a>
                                <p>

                                    会员包月

                                </p>
                                <p>享受月度票价9折优惠</p>
                                <%--<a  href="${pageContext.request.contextPath}/front/vipPayMonth.jsp">点击购买</a>--%>
                                <input name="购买" type="button" id="btn1" value="购买" />
                                <input type="hidden" name="type" id="type"  value="M" />
                                <input type="hidden" name="price" id="price"  value="30" />
                            </div>
                            <div>
                                <i>包月/30RMB</i>
                            </div>
                        </div>
                    </dd>
        </dl>
    </div>
</div>
<!-- 喵 -->
<a class="miao" href="#" target="blank"></a>

<script src="${pageContext.request.contextPath}/front/style/JS/jquery-1.11.0.min.js"></script>
<script src="${pageContext.request.contextPath}/front/style/JS/jquery-3.2.1.js"></script>
<script>
    var accountId = "${sessionScope.account.accountId}"
        $("#btn1").click(function(){
            if(accountId == ""){
                alert("请登入账号");
            }else{
                $.ajax({
                    url:"${pageContext.request.contextPath}/back/vipOrdersInfo",
                    data:{
                        accountId:accountId
                        ,vipTypeId:$("#type").val()
                        ,vipOrdersPrice:$("#price").val()
                    },
                    type:"post",
                    async:true,
                    dataType:"text",
                    success : function(data) {

                    },
                    error : function() {
                        alert("error");
                    }
                });
                location.href='${pageContext.request.contextPath}/front/vipPayMonth.jsp';
            }
        });

        $("#btn2").click(function(){
            if(accountId == ""){
                alert("请登入账号");
            }else{
                $.ajax({
                    url:"${pageContext.request.contextPath}/back/vipOrdersInfo",
                    data:{
                        accountId:accountId
                        ,vipTypeId:$("#type2").val()
                        ,vipOrdersPrice:$("#price2").val()
                    },
                    type:"post",
                    async:true,
                    dataType:"text",
                    success : function(data) {

                    },
                    error : function() {
                        alert("error");
                    }
                });
                location.href='${pageContext.request.contextPath}/front/vipPaySeason.jsp'
            }
        });
        $("#btn3").click(function(){
            if(accountId == ""){
                alert("请登入账号");
            }else{
            $.ajax({
                url:"${pageContext.request.contextPath}/back/vipOrdersInfo",
                data:{
                    accountId:accountId
                    ,vipTypeId:$("#type3").val()
                    ,vipOrdersPrice:$("#price3").val()
                },
                type:"post",
                async:true,
                dataType:"text",
                success : function(data) {

                },
                error : function() {
                    alert("error");
                }
            });
                location.href='${pageContext.request.contextPath}/front/vipPayYear.jsp';
            }
        });


</script>
</body>
<script type="text/javascript">
    // 判断是否登录
    var account = "${sessionScope.account}";
    if(account != ""){
        $(".denglu img").prop("src","${pageContext.request.contextPath}/download/img?fileName=${sessionScope.account.accountPicture}");
        $("#showStatus").text("退出登录");
        $("#showStatus").prop("src","#");
    }
    $(document).on("click","#showStatus",function(){
        if($(this).text()=="退出登录"){
            $.ajax({
                url:"${pageContext.request.contextPath}/front/logout",
                success:function(){
                    console.log("退出成功");
                },
                error:function(){
                    console.log("退出失败");
                }
            });
        }
    })

</script>

</html>
